/*  1:   */ package org.intellij.images.fileTypes.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeConsumer;
import com.intellij.openapi.fileTypes.UserBinaryFileType;
import com.intellij.openapi.fileTypes.UserFileType;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import gnu.trove.THashSet;
import icons.ImagesIcons;
import org.intellij.images.ImagesBundle;
import org.intellij.images.fileTypes.ImageFileTypeManager;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

import javax.imageio.ImageIO;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */
/* 16:   */
/* 17:   */
/* 18:   */ 
/* 19:   */ final class ImageFileTypeManagerImpl
/* 20:   */   extends ImageFileTypeManager
/* 21:   */   implements ApplicationComponent
/* 22:   */ {
/* 23:   */   @NonNls
/* 24:   */   private static final String a = "ImagesFileTypeManager";
/* 25:   */   @NonNls
/* 26:   */   private static final String b = "Images";
/* 27:42 */   private static final String c = ImagesBundle.message("images.filetype.description", new Object[0]);
/* 28:46 */   private static final UserFileType d = new ImageFileType();
/* 29:   */   
/* 30:   */   static
/* 31:   */   {
/* 32:47 */     d.setIcon(ImagesIcons.ImagesFileType);
/* 33:48 */     d.setName("Images");
/* 34:49 */     d.setDescription(c);
/* 35:   */   }
/* 36:   */   
/* 37:   */   public boolean isImage(VirtualFile paramVirtualFile)
/* 38:   */   {
/* 39:56 */     return paramVirtualFile.getFileType() instanceof ImageFileType;
/* 40:   */   }
/* 41:   */   
/* 42:   */   public FileType getImageFileType()
/* 43:   */   {
/* 44:60 */     return d;
/* 45:   */   }
/* 46:   */   
/* 47:   */   @NotNull
/* 48:   */   public String getComponentName()
/* 49:   */   {
/* 50:65 */     String tmp2_0 = "ImagesFileTypeManager";
/* 51:65 */     if (tmp2_0 == null) {
/* 52:65 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/images/fileTypes/impl/ImageFileTypeManagerImpl", "getComponentName" }));
/* 53:   */     }
/* 54:65 */     return tmp2_0;
/* 55:   */   }
/* 56:   */   
/* 57:   */   public void createFileTypes(@NotNull FileTypeConsumer paramFileTypeConsumer)
/* 58:   */   {
/* 59:78 */     if (paramFileTypeConsumer == null) {
/* 60:78 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/images/fileTypes/impl/ImageFileTypeManagerImpl", "createFileTypes" }));
/* 61:   */     }
/* 62:78 */     THashSet localTHashSet = new THashSet();
/* 63:   */     
/* 64:80 */     String[] arrayOfString1 = ImageIO.getReaderFormatNames();
/* 65:81 */     for (String str1 : arrayOfString1)
/* 66:   */     {
/* 67:82 */       String str2 = str1.toLowerCase();
/* 68:83 */       localTHashSet.add(str2);
/* 69:   */     }
/* 70:86 */     localTHashSet.add("ico".toLowerCase());
/* 71:   */     
/* 72:88 */     paramFileTypeConsumer.consume(d, StringUtil.join(localTHashSet, ";"));
/* 73:   */   }
/* 74:   */   
/* 75:   */   public void initComponent() {}
/* 76:   */   
/* 77:   */   public void disposeComponent() {}
/* 78:   */   
/* 79:   */   public static final class ImageFileType
/* 80:   */     extends UserBinaryFileType
/* 81:   */   {}
/* 82:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.fileTypes.impl.ImageFileTypeManagerImpl

 * JD-Core Version:    0.7.0.1

 */